package com.han.fu.api.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.han.fu.api.business.entity.Follow;
import com.han.fu.api.business.model.ao.FollowPageAo;
import com.han.fu.api.business.model.vo.FollowVo;
import org.apache.ibatis.annotations.Mapper;

/**
 * 关注Mapper接口
 *
 * @author star
 * @date 2021-08-12
 */
@Mapper
public interface FollowMapper extends BaseMapper<Follow> {

    /**
     * 关注分页查询
     *
     * @param ao 分页查询条件
     * @return Page<FollowVo> 分页数据
     */
    Page<FollowVo> queryFollowPage(FollowPageAo ao);

    /**
     * 取消关注
     *
     * @param entity
     */
    void cancelFollow(Follow entity);

    /**
     * 查询关注某用户数量
     *
     * @param entity
     * @return int
     */
    int queryFollowCount(Follow entity);

}
